//
//  XJOrderDetailCell4.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/6/21.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJOrderDetailCell4.h"

#import "XJOrderDetailBigModel.h"

@interface XJOrderDetailCell4()
/**1.订单号LB*/
@property (weak, nonatomic) IBOutlet UILabel *orderSNLb;
/**2.订单创建时间*/
@property (weak, nonatomic) IBOutlet UILabel *orderSNCreateTimeLb;

@end

@implementation XJOrderDetailCell4

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(XJOrderDetailBigModel *)model {
    _model = model;
    
    self.orderSNLb.text = [NSString stringWithFormat:@"%@",model.order_sn];
    
    
    
    NSString *stampStr = [NSString stringWithFormat:@"%@",model.create_time];
    self.orderSNCreateTimeLb.text = [self timeStrFromTimeStamp:stampStr];

}

//时间戳转时间
- (NSString *)timeStrFromTimeStamp:(NSString *)timeStamp {
    
    NSTimeInterval interval = [timeStamp doubleValue] / 1000.0; //记得除1000.0
    
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
    
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    [fmt setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    
    return [fmt stringFromDate:date];
}

@end
